import 'package:base_lib/app.dart';
import 'package:base_lib/common/bus/ibus.dart';
import 'package:base_lib/router/page_builder.dart';
import 'package:doctor_prescribe_lib/chinese_medicine/dosage/page.dart';
import 'package:doctor_prescribe_lib/chinese_medicine/edit_medication/page.dart';
import 'package:doctor_prescribe_lib/chinese_medicine/medicine_search/page.dart';
import 'package:doctor_prescribe_lib/diagnostic_result/page.dart';
import 'package:doctor_prescribe_lib/edit_shipping_address/page.dart';
import 'package:doctor_prescribe_lib/rp_order/page.dart';
import 'package:doctor_prescribe_lib/western_medicine/medical_search/page.dart';
import 'package:doctor_prescribe_lib/western_medicine/prescription_page/page.dart';
import 'package:doctor_prescribe_lib/repository/http.dart';
import 'chinese_medicine/prescription_page/page.dart';
import 'western_medicine/medical_search/page.dart';
import 'western_medicine/edit_medical/page.dart';
import 'offline/basic_info/page.dart';

///开处方组件
class DoctorPrescribeComponent extends IComponent {
  static const String AssetsPackageName = "DoctorPrescribeComponent-";

  static const String addPrescribePage = "${AssetsPackageName}addPrescribePage";

  ///线下 -基本信息
  static const String offlineBasicInfoPage =
      "${AssetsPackageName}offlineBasicInfoPage";

  ///诊断结果
  static const String diagnosticResultPage =
      "${AssetsPackageName}diagnosticResultPage";

  ///西药-处方开立页
  static const String westPrescriptionPage =
      "${AssetsPackageName}westPrescriptionPage";

  ///西药-药品搜索页
  static const String medicalSearchPage =
      "${AssetsPackageName}medicalSearchPage";

  ///西药-药品编辑页  用法用量
  static const String medicalEditPage = "${AssetsPackageName}drugSearchPage";

  ///中药-处方开立页
  static const String chinesePrescriptionPage =
      "${AssetsPackageName}chinesePrescriptionPage";

  ///中药-编辑用药页
  static const String chineseMedicalEditPage =
      "${AssetsPackageName}chineseMedicalEditPage";

  ///中药-搜索药品页
  static const String chineseMedicineSearchPage =
      "${AssetsPackageName}chineseMedicineSearchPage";

  ///中药-用法用量页
  static const String chineseDosagePage =
      "${AssetsPackageName}chineseDosagePage";

  ///处方-订单详情页
  static const String rpOrderPage = "${AssetsPackageName}rpOrderPage";

  ///处方-编辑收货地址
  static const String editShippingAddressPage =
      "${AssetsPackageName}editShippingAddressPage";

  @override
  void doComponentInitConfig() {
    PrescribeHttp.createHttpProxy();
  }

  @override
  List<EventBuilder> gePublicEvents() {
    return [];
  }

  @override
  getComponentName() => AssetsPackageName;

  @override
  List<PageBuilder> getPages() {
    return [
      PageBuilder(offlineBasicInfoPage, (params) {
        return OfflineBasicInfoPage(params);
      }),
      PageBuilder(diagnosticResultPage, (params) {
        return DiagnosticSearchPage(params);
      }),
      PageBuilder(westPrescriptionPage, (params) {
        return PrescriptionPage(params);
      }),
      PageBuilder(medicalSearchPage, (params) {
        return MedicalSearchPage(params);
      }),
      PageBuilder(medicalEditPage, (params) {
        return MedicalEditPage(params);
      }),
      PageBuilder(westPrescriptionPage, (params) {
        return PrescriptionPage(params);
      }),
      PageBuilder(chinesePrescriptionPage, (params) {
        return ChinesePrescriptionPage(params);
      }),
      PageBuilder(chineseMedicalEditPage, (params) {
        return ChineseEditMedicinePage(params);
      }),
      PageBuilder(chineseMedicineSearchPage, (params) {
        return ChineseMedicineSearchPage(params);
      }),
      PageBuilder(chineseDosagePage, (params) {
        return ChineseDosagePage(params);
      }),
      PageBuilder(rpOrderPage, (params) {
        return RpOrderPage(params);
      }),
      PageBuilder(editShippingAddressPage, (params) {
        return EditShippingAddressPage(params);
      }),
    ];
  }
}
